package sogo.myi.micro.ribbo.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;

@Service
public class HelloService {

	@Resource
	private RestTemplate restTemplate;
	
	@HystrixCommand(fallbackMethod = "serviceFailure")
	public String getContentHelloworld(){
		return restTemplate.getForObject("http://SERVICE-HELLOWORLD/helloworld", String.class);
	}
	
	public String serviceFailure(){
		return "getContentHelloworld service api failure...";
	}
}
